﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace TB_WS.ASMX
{
    /// <summary>
    /// Event 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class Event : System.Web.Services.WebService
    {

       [WebMethod(Description ="新增EventInfo")]
       public int INSERT_EVENT(int Seller_ID,string Event_Key,string Event_Value)
        {
            if(Class.Event.get_Event_Count(Event_Key,Seller_ID)>0)
            {
                return -1;
            }
            else
            {
                Class.Event.insert_Event(Seller_ID, Event_Key, Event_Value);
                return 0;
            }
        }

        [WebMethod(Description ="更新Event_Value")]
        public int Update_Event(int Seller_ID, string Event_Key, string Event_Value)
        {
            return Class.Event.update_Event(Event_Key, Event_Value, Seller_ID);
        }

        [WebMethod(Description ="删除Event")]
        public int Delete_Event(int Seller_ID,string Event_Key)
        {
            return Class.Event.Delete_Event(Event_Key, Seller_ID);
        }

        [WebMethod(Description ="获取Event列表")]
        public DataSet GET_ALL_EVENT(int Seller_ID)
        {
            return Class.Event.get_all_Event(Seller_ID);
        }

        [WebMethod(Description = "获取Event详情")]
        public DataSet GET_EVENT_INFO(int Seller_ID, string Event_Key)
        {
            return Class.Event.get_Event_Info(Event_Key, Seller_ID);
        }
    }
}
